public class Test37 {


    public static void main(String[] args) {
        String A="youzan";
        String B="zyouan";

        System.out.println(solve(A, B));
    }
    public static boolean solve (String A, String B) {
        if(A.equals(B)) return true;
        else{
            char[] a=A.toCharArray();
            char[] b=B.toCharArray();
            if( a.length != b.length) return false;
            int left=0,right=a.length-1;
            while(right!=0){
                if(left < a.length && right >=0 && a[left++] != b[right--]) return false;
            }
            return true;
        }
    }
}
